<?php

namespace app\common;

use think\facade\Log;

define("LOG_ID", md5(microtime(true) . rand(10000000000,999999999999)));

/**
 * @see Log
 * @mixin Log
 * 统一日志处理，增加链路追踪日志ID，请求URL ，便于日志排查问题
 * 业务必须调用此类打日志
 */
class JwpLog
{
    public static function __callStatic($name, $arguments)
    {
        $res = [Log::class,$name];
        $url = $_SERVER['PATH_INFO'];
        $arguments[0] = sprintf("logid[%s] url[%s] %s", LOG_ID, $url, $arguments[0]);
         call_user_func_array($res, $arguments);
    }
}